
// 根据路径匹配对应的 menu，只需要第二级菜单即可
export function pathMapTags(userMenus, currentPath) {
  for (const menu of userMenus) {
    if (menu.type === 1) {
      const findMenu = pathMapTags(menu.children ?? [], currentPath)
      if (findMenu) {
        return findMenu
      }
    } else if (menu.type === 2 && menu.path === currentPath) {
      return menu
    }
  }
}